import http from '@/utils/request.js'

http.defaults.withCredentials = true

let cookie = 'JSESSIONID=5A8D9F4E7F8C0D5B8E9F0C1D3A2B4C5D6; Path=/; HttpOnly; Secure'

//创建经销商
export const createDistri = (obj) => {
    return http.post('/distributors/sub_distributors', obj, {
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
                'Cookie': cookie
            }
        }
    )

}

//获取经销商列表
export const getDistri = () => {
    return http.get('/distributors/sub_distributors')
}

//添加子经销商和医院关系
export const addDistriAndHospital = (data) => {
    return http.patch('/distributors/sub_distributors/<sub_distributor_id>/relation_hospitals/',data )
}
